🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / component / ContactSharing.kt
Displaying Raw • Download
core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/ContactSharing.kt 520fa717a938fd84682403b41f57d9f7e1ef49ef (520fa717) Text, 2.32 KB
T8b949e/*
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tf0883e@fileTb4b4b4:Te6edf3SuppressTb4b4b4(Ta5d6ff"Ta5d6ffdetekt:ALLTa5d6ff"Tb4b4b4)
Tff7b72package T7ee787org.meshtastic.core.ui.component
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.model.Node
Tff7b72import T7ee787org.meshtastic.core.model.util.getSharedContactUrl
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.share_contact
Tff7b72import T7ee787org.meshtastic.core.ui.util.rememberQrCodePainter
Tff7b72import T7ee787org.meshtastic.proto.SharedContact
T8b949e/**
* Displays a dialog with the contact's information as a QR code and URI.
*
* @param contact The node representing the contact to share. Null if no contact is selected.
* @param onDismiss Callback invoked when the dialog is dismissed.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffSharedContactDialogTb4b4b4(Te6edf3contactTb4b4b4: Te6edf3Node?Tb4b4b4, Te6edf3onDismissTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3contact Tff7b72=Tff7b72= Tff7b72nullTb4b4b4) Tff7b72return
Tff7b72val Te6edf3contactToShare Tff7b72= Te6edf3SharedContactTb4b4b4(Te6edf3user Tff7b72= Te6edf3contactTb4b4b4.Te6edf3userTb4b4b4, Te6edf3node_num Tff7b72= Te6edf3contactTb4b4b4.Te6edf3numTb4b4b4)
Tff7b72val Te6edf3commonUri Tff7b72= Te6edf3contactToShareTb4b4b4.Te6edf3getSharedContactUrlTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3uriString Tff7b72= Te6edf3commonUriTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3qrPainter Tff7b72= Te6edf3rememberQrCodePainterTb4b4b4(Te6edf3uriStringTb4b4b4, T79c0ff9T79c0ff6T79c0ff0Tb4b4b4)
Te6edf3QrDialogTb4b4b4(
Te6edf3title Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3share_contactTb4b4b4)Tb4b4b4,
Te6edf3uriString Tff7b72= Te6edf3uriStringTb4b4b4,
Te6edf3qrPainter Tff7b72= Te6edf3qrPainterTb4b4b4,
Te6edf3onDismiss Tff7b72= Te6edf3onDismissTb4b4b4,
Tb4b4b4)
Tb4b4b4}
T8b949e/**
* Displays a dialog for importing a shared contact.
*
* @param sharedContact The [SharedContact] to import.
* @param onDismiss Callback invoked when the dialog is dismissed.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffSharedContactImportDialogTb4b4b4(Te6edf3sharedContactTb4b4b4: Te6edf3SharedContactTb4b4b4, Te6edf3onDismissTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4) Tb4b4b4{
Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3uiTb4b4b4.Te6edf3shareTb4b4b4.Te6edf3SharedContactDialogTb4b4b4(Te6edf3sharedContact Tff7b72= Te6edf3sharedContactTb4b4b4, Te6edf3onDismiss Tff7b72= Te6edf3onDismissTb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s